import React, {Component} from 'react';

export var fullpageEnhance =  ComposedComponent => class extends Component {

    static displayName = 'ComponentEnhanceWithFullPage';

    componentDidMount() {
        $(this.refs.composed.refs.fullpage).fullpage({
            paddingTop: "67px",
            navigation: true
        });
    }

    componentWillUnmount() {
        $.fn.fullpage.destroy("all");
    }


    render() {
        return <ComposedComponent {...this.props} {...this.state} ref="composed"/>;
    }
}